package edu.hawaii.duedates;

import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

/**
 * ProjectTimer uses timer to schedule a task.
 * 
 * @author Mari-Lee Flestado, John Ancheta, Daniel Arakaki 
 *
 */
public class ProjectTimer {  
  Timer timer = new Timer();
   
  /**
   * This method schedules the time that the task should be executed. 
   * 
   * @param task The task that needs to be executed.
   * @param days The time interval that the task needs to be executed.
   */
  public void schedule(TimerTask task, double days) {
    Date firstTime = new Date();
    timer.schedule(task, firstTime, (long) (days * 24 * 60 * 60));
  }
               
}
